﻿@page "/search"
@inject IStringLocalizer<Searches> Localizer

<h3>@Localizer["SearchesTitle"]</h3>

<h4>@Localizer["SearchesSubTitle"]</h4>

<DemoBlock Title="@Localizer["SearchesNormalTitle"]"
           Introduction="@Localizer["SearchesNormalIntro"]"
           Name="Normal">
    <p>@((MarkupString)Localizer["SearchesNormalDescription"].Value)</p>
    <Search IgnoreCase="true"
            IsLikeMatch="true"
            IsAutoFocus="true"
            PlaceHolder="@Localizer["SearchesPlaceHolder"]"
            Items="@Items"
            OnSearch="@OnSearch"
            IsSelectAllTextOnFocus="true" />
    <ConsoleLogger @ref="Logger" />
</DemoBlock>

<DemoBlock Title="@Localizer["SearchesClearValueTitle"]"
           Introduction="@Localizer["SearchesClearValueIntro"]"
           Name="ClearValue">
    <Search IgnoreCase="true"
            IsLikeMatch="true"
            IsAutoClearAfterSearch="true"
            PlaceHolder="@Localizer["SearchesPlaceHolder"]"
            Items="@Items"
            OnSearch="@OnClearSearch" />
    <ConsoleLogger @ref="ClearLogger" />
</DemoBlock>

<DemoBlock Title="@Localizer["SearchesDisplayButtonTitle"]"
           Introduction="@Localizer["SearchesDisplayButtonIntro"]"
           Name="DisplayButton">
    <Search IgnoreCase="true"
            IsLikeMatch="true"
            PlaceHolder="@Localizer["SearchesPlaceHolder"]"
            ShowClearButton="true"
            Items="@Items"
            OnSearch="@OnDisplaySearch"
            OnClear="@OnClear"></Search>
    <ConsoleLogger @ref="DisplayLogger" />
</DemoBlock>

<DemoBlock Title="@Localizer["SearchesKeyboardsTitle"]"
           Introduction="@Localizer["SearchesKeyboardsIntro"]"
           Name="keyboards">
    <Search IgnoreCase="true"
            IsLikeMatch="true"
            PlaceHolder="@Localizer["SearchesPlaceHolder"]"
            IsOnInputTrigger="true"
            Items="@Items"
            OnSearch="@OnKeyboardSearch" />
    <ConsoleLogger @ref="KeyboardLogger" />
</DemoBlock>

<DemoBlock Title="@Localizer["SearchesValidateFormTitle"]"
           Introduction="@Localizer["SearchesValidateFormIntro"]"
           Name="ValidateForm">
    <ValidateForm Model="@Model">
        <Search Items="StaticItems" IsOnInputTrigger="true" @bind-Value="Model.Name" />
    </ValidateForm>
</DemoBlock>

<AttributeTable Items="@GetAttributes()" />
